home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / chat / 12 / 12.exe / SYSTEM / maxtime.mrc < prev    next >
Encoding:
Text File  |  2000-03-04  |  2.8 KB  |  68 lines

  1. ;%%%%%%%%%%%%%%%%%%%%%%%%
  2. ;script Max On/Up time script
  3. ;version 1.0
  4. ;author BARtMAN
  5. ;email bartman@ircN.org
  6. ;url http://www.ircN.org/
  7. ;%%%%%%%%%%%%%%%%%%%%%%%%
  8. on 1:LOAD {
  9.   .timerMonTIME 0 30 montime
  10.   .timerMupTIME 0 30 muptime
  11. }
  12. on 1:CONNECT {
  13.   .timerMonTIME 0 30 montime
  14.   .timerMupTIME 0 30 muptime
  15. }
  16. on 1:DISCONNECT { .timerMupTIME 0 30 muptime }  
  17. alias muptime {
  18.   var %a = $ticks, %z
  19.   if (%muptime == $null) set %muptime 0
  20.   if (%a > %muptime) {
  21.     if (($rrpt($sub(%a,%muptime)) >= 3600) || ($sub($ctime,%muptime.date) >= 86400)) {
  22.       iecho Congratulations! You have beaten your old uptime record of $hc($msdur($rrpt(%muptime))) ( $+ by $sc($msdur($rrpt($sub(%a,%muptime)))) $+ ).
  23.       iecho Your new uptime record is $hc($msdur($rrpt($ticks))) $+ , set on $asc-time($ctime) $+ .
  24.     }
  25.     set %muptime %a
  26.     set %muptime.date $ctime
  27.     set %z $true
  28.     .save -rv $readini -n $mircini rfiles n1
  29.   }
  30.   if ($1 == -s) msg $active My computer's maximum uptime: $b($msdur($rrpt(%muptime))) $+ , set on $asc-time(%muptime.date)
  31.   if ($1 == -e) {
  32.     if (%z) iecho Your computer's maximum and current uptime: $hc($msdur($rrpt(%muptime))) $+ .
  33.     else {
  34.       iecho Your computer's maximum uptime: $hc($msdur($rrpt(%muptime))) $+ , set on $asc-time(%muptime.date) ( $+ $sc($msdur($sub($ctime,%muptime.date))) ago).
  35.       iecho Your current uptime is $hc($msdur($rrpt(%a))) $+ ; you have $sc($msdur($rrpt($sub(%muptime,$ticks)))) until you reach your old record.
  36.     }
  37.   }
  38. }
  39. alias montime {
  40.   var %a = $online, %z
  41.   if (%montime == $null) set %montime 0
  42.   if ((%a > %montime) && ($server)) {
  43.     set %montime.server $server $+ : $+ $port
  44.     if (($sub(%a,%montime) >= 3600) || ($sub($ctime,%montime.date) >= 86400)) {
  45.       iecho Congratulations! You have beaten your old ontime record of $hc($msdur($calc(%montime))) ( $+ by $sc($msdur($sub(%a,%montime))) $+ ).
  46.       iecho Your new online time record is $hc($msdur($online)) $+ , set on $asc-time($ctime) on $server $+ : $+ $port $+ .
  47.     }
  48.     set %montime %a
  49.     set %montime.date $ctime
  50.     set %z $true
  51.     .save -rv $readini -n $mircini rfiles n1
  52.   }
  53.   if ($1 == -s) msg $active My computer's maximum ontime: $b($msdur(%montime)) $+ , set on $asc-time(%montime.date) on %montime.server
  54.   if ($1 == -e) {
  55.     if (%z) iecho Your computer's maximum and current online time: $hc($msdur($online)) $+ , set on %montime.server $+ .
  56.     else {
  57.       iecho Your maximum online time: $hc($msdur(%montime)) $+ , set on $asc-time(%montime.date) ( $+ $sc($msdur($sub($ctime,%montime.date))) ago) on %montime.server
  58.       iecho Current ontime is $hc($msdur(%a)) $+ ; you have $sc($msdur($sub(%montime,$online))) until you reach your old record.
  59.     }
  60.   }
  61. }
  62. alias msdur {
  63.   var %z = $iduration($1)
  64.   if ($chr(44) isin %z) return %z
  65.   if ($len(%z) >= 23) return $rsc2(%z)
  66.   else return %z
  67. }
  68.